package com.sinosoft.bee.services.cousumerwithfeign.config;

import feign.Contract;
import feign.auth.BasicAuthRequestInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 配置feign，放置在父容器之外
 * @author:TobbyQuinn
 * @date:2018/4/26
 * @project:bee
 **/
@Configuration
public class BeeProviderDemoConfiguration {

    @Bean
    public Contract feignContract() {
        return new feign.Contract.Default();
    }

    /**
     * http验证
     * @return
     */
    @Bean
    public BasicAuthRequestInterceptor basicAuthRequestInterceptor() {
        return new BasicAuthRequestInterceptor("root", "123456");
    }
}
